<?xml version="1.0"?>
<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<pdf>
    <head>
        <link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}"
              src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}"
              src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2"/>
        <link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}"
              src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2"/>
        <meta charset="utf-8"/>
        <title></title>
        <style>
            * {
                <#if .locale == "zh_CN" >
                font-family: NotoSans, NotoSansCJKsc, sans-serif;
                <#elseif .locale == "zh_TW">
                font-family: NotoSans, NotoSansCJKtc, sans-serif;
                <#elseif .locale == "ja_JP">
                font-family: NotoSans, NotoSansCJKjp, sans-serif;
                <#elseif .locale == "ko_KR">
                font-family: NotoSans, NotoSansCJKkr, sans-serif;
                <#elseif .locale == "th_TH">
                font-family: NotoSans, NotoSansThai, sans-serif;
                <#else>
                font-family: NotoSans, NotoSansCJKsc, sans-serif;
                </#if>
            }
            /** {*/
                /*margin: 0;*/
                /*padding: 0;*/
            /*}*/

            body {
                width: 21.5cm;
                height: 14cm;
                margin: 0;
                padding: 0;
                background-color: #FFFFFF;
                text-align: center;
            }

            /*table {*/
                /*!*width: 800px;*!*/
                /*height: auto;*/
                /*margin: 0 auto;*/
                /*margin-bottom: 100px;*/
            /*}*/

            /*table td {*/
                /*font-size: 15px;*/
                /*text-align: center;*/
                /*word-wrap: break-word;*/
                /*!* word-break: break-all; *!*/
            /*}*/
            table {
                table-layout:fixed;
                margin: -10px 5px 0 5px;
            }
            table td {
                font-size: 15px;
                text-align: center;
                word-wrap: break-word;
                word-break: break-all;
            }
            table td p {
                width: 100%;
                /*height: auto;*/
                color: #000;
                word-wrap: break-word;
                word-break: break-all;
            }
            table td  {
                height: 20px;
            }
            table .td1 {
                width: 4%;
            }

            table .td2 {
                width: 6%;
            }

            table .td3 {
                width: 6%;
            }

            table .td4 {
                width: 6%;
            }

            table .td5 {
                width: 9%;
            }

            table .td6 {
                width: 6%;
            }

            table .td7 {
                width: 5%;
            }

            table .td8 {
                width: 4%;
            }

            table .td9 {
                width: 4%;
            }

            table .td10 {
                width: 4%;
            }

            table .td11 {
                width: 4%;
            }

            table .td12 {
                width: 4%;
            }

            table .td13 {
                width: 4%;
            }

            table .td14 {
                width: 4%;
            }

            table .td15 {
                width: 6%;
            }

            table .td16 {
                width: 6%;
            }

            table .td17 {
                width: 4%;
            }

            table .td18 {
                width: 5%;
            }

            table .td19 {
                width: 9%;
            }

            .leftBorder {
                border-left: 1px solid #000000;
            }

            .rightBorder {
                border-right: 1px solid #000000;
            }

            .topBorder {
                border-top: 1px solid #000000;
            }

            .bottomBorder {
                border-bottom: 1px solid #000000;
            }

            .border {
                border: 1px solid #000000;
            }
        </style>
    </head>
    <body>
    <#assign pageSize=((label.itemList?size)/5)?ceiling ?number>
    <#list 1..pageSize as i>
    <#if i <= pageSize >
    <div style="height:100%;">
    <table cellspacing="0" cellpadding="0" width="21cm">
        <tr>
            <td  class="td1"></td>
            <td  class="td2"></td>
            <td  class="td3"></td>
            <td  class="td4"></td>
            <td  class="td5"></td>
            <td  class="td6"></td>
            <td  class="td7"></td>
            <td  class="td8"></td>
            <td  class="td9"></td>
            <td  class="td10"></td>
            <td  class="td11"></td>
            <td  class="td12"></td>
            <td  class="td13"></td>
            <td  class="td14"></td>
            <td  class="td15"></td>
            <td  class="td16"></td>
            <td  class="td17"></td>
            <td  class="td18"></td>
            <td  class="td19"></td>
        </tr>
        <tr>
            <td colspan="19">
                <p style="text-align: center;font-size: 30px;font-weight: 600;line-height: 30px;">
                    销售订单表
                </p>
            </td>
        </tr>
        <tr>
            <td colspan="10">
                <p style="text-align: left;font-size:  12px;line-height:15px;">
                    采购单位：<span style="font-size: 14px;line-height: 15px; text-decoration: underline;">${label.customer}</span>
                </p>
                <p style="text-align: left;font-size:  12px;line-height:15px;">
                    销售单位：<span style="font-size: 14px;line-height: 15px; text-decoration: underline;">${label.subsidiaryText}</span>
                </p>
                <p style="text-align: left;font-size:  12px;line-height:15px;">
                    销售渠道:<span style="font-size:  12px;line-height: 15px; text-decoration: underline;">${label.custbody_saleschannels}</span>
                </p>
                <p style="text-align: left;font-size:  12px;line-height:15px;">
                    采购订单:<span style="font-size:  12px;line-height: 15px; text-decoration: underline;">${label.otherrefnum}</span>
                </p>
            </td>
            <td colspan="10">
                <p style="text-align: right;font-size:  12px;line-height:15px;">
                    NO：${label.tranid}
                </p>
                <p style="text-align: right;font-size:  12px;line-height:15px;">
                    下单日期：<span style="font-size: 14px;line-height: 15px; text-decoration: underline;">${label.trandate_year}</span>年<span style="font-size: 14px;line-height: 20px; text-decoration: underline;">${label.trandate_month}</span>月<span style="font-size: 14px;line-height: 20px; text-decoration: underline;">${label.trandate_date}</span>日
                </p>
                <p style="text-align: right;font-size:  12px;line-height:15px;">
                    币种：<span style="font-size: 14px;line-height: 15px; text-decoration: underline;">${label.currency}</span>
                </p>
                <p style="text-align: right;font-size:  12px;line-height:15px;">
                    汇率：<span style="font-size: 14px;line-height: 15px; text-decoration: underline;">${label.exchangerate}</span>
                </p>
            </td>
        </tr>
        <tr>
            <td class="td1 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">序号</p>
            </td>
            <td class="td2 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">国家</p>
            </td>
            <td class="td3 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">交货日期</p>
            </td>
            <td class="td4 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">SKU</p>
            </td>
            <td class="td5 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">中文名称</p>
            </td>
            <td class="td6 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">产品名称编码</p>
            </td>
            <td class="td7 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">尺寸</p>
            </td>
            <td class="td8 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">色号</p>
            </td>
            <td class="td9 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">颜色</p>
            </td>
            <td class="td10 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">花型名称</p>
            </td>
            <td class="td11 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">花型色号</p>
            </td>
            <td class="td12 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">单位</p>
            </td>
            <td class="td13 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">订单数量</p>
            </td>
            <td class="td14 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">未税单价</p>
            </td>
            <td class="td15 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">未税金额</p>
            </td>
            <td class="td16 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">含税金额</p>
            </td>
            <td class="td17 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">交易方式</p>
            </td>
            <td class="td18 leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">价格</p>
            </td>
            <td class="td19 leftBorder topBorder rightBorder">
                <p style="text-align: center;font-size: 8px;font-weight: 600; ">备注</p>
            </td>
        </tr>
        <#assign totalQty=0?number>
        <#assign totalAmount=0?number>
        <#assign totalGrossAmount=0?number>
        <#list label.itemList as item>
        <#if (item_index+1) gt 5*(i-1) && (item_index+1) lte 5*i>
        <#assign totalQty = totalQty+item.quantity?number>
        <#assign totalAmount = totalAmount+item.amount?number>
        <#assign totalGrossAmount = totalGrossAmount+item.grossAmount?number>
        <tr>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.no}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.journal_country}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.delivery_date}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.sku}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.chinese_name}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.itemid}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.specification}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.colornumber}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.color}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.flower_type}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.flower_type_color}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.units}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.quantity}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.rate}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.amount}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.grossamount}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.trade_pay_method}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.trade_price}</p>
            </td>
            <td class="leftBorder topBorder rightBorder">
                <p style="text-align: center;font-size: 8px;line-height: 8px;">${item.remarks}</p>
            </td>
        </tr>
    </#if>
    </#list>

    <#if i=pageSize && (label.itemList?size)%5 != 0>
    <#list 1..(5-((label.itemList?size)%5)) as j>
    <#if j <= (5-((label.itemList?size)%5)) >
    <tr>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;">${label.itemList?size + j}</p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
        <td class="leftBorder topBorder rightBorder">
            <p style="text-align: center;font-size: 8px;line-height: 8px;"></p>
        </td>
    </tr>
</#if>
</#list>
</#if>
        <tr>
            <td class="leftBorder topBorder" colspan="12">
                <p style="text-align: center;font-size: 8px;line-height: 16px;">总计</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 16px;">${label.total_quantity}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 16px;">${label.total_rate}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 16px;">${label.total_amount_yb}</p>
            </td>
            <td class="leftBorder topBorder">
                <p style="text-align: center;font-size: 8px;line-height: 16px;">${label.total_grossamount_yb}</p>
            </td>
            <td class="leftBorder topBorder rightBorder" colspan="3">
                <p style="text-align: center;font-size: 8px;line-height: 16px;"></p>
            </td>
        </tr>
        <tr>
            <td class="leftBorder topBorder" colspan="18"></td>
            <td class="leftBorder topBorder rightBorder">
                <p style="width: 100%;text-align: left;font-size: 8px;line-height: 16px;"><!--打印次数：4次--></p>
            </td>
        </tr>
        <tr>
            <td class="leftBorder topBorder rightBorder" colspan="19">
                <table style="width: 100%;margin: 0;">
                    <tr>
                        <td style="width: 6%;">
                            <p style="text-align:left;font-size: 8px;line-height: 14px;">总计:</p>
                        </td>
                        <td style="width: 6%;">
                            <p style="text-align:left;font-size: 8px;line-height: 14px;">原币:</p>
                        </td>
                        <td style="width: 25%;">
                            <p style="text-align:left;font-size: 8px;line-height: 14px;">未税金额:${label.currency}${label.total_amount_yb}</p>
                        </td>
                        <td style="width: 25%;">
                            <p style="text-align:left;font-size: 8px;line-height: 14px;">税额:${label.currency}${label.total_tax_yb}</p>
                        </td>
                        <td style="width: 38%;">
                            <p style="text-align:left;font-size: 8px;line-height: 14px;">含税金额:${label.currency}${label.total_grossamount_yb}</p>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 6%;">
                            <p style="text-align:left;font-size: 8px;line-height: 14px;"></p>
                        </td>
                        <td style="width: 6%;">
                            <p style="text-align:left;font-size: 8px;line-height: 14px;">本位币:</p>
                        </td>
                        <td style="width: 25%;">
                            <p style="text-align:left;font-size: 8px;line-height: 14px;">未税金额:${label.currency_bwb}${label.total_amount_bwb}</p>
                        </td>
                        <td style="width: 25%;">
                            <p style="text-align:left;font-size: 8px;line-height: 14px;">税额:${label.currency_bwb}${label.total_tax_bwb}</p>
                        </td>
                        <td style="width: 38%;">
                            <p style="text-align:left;font-size: 8px;line-height: 14px;">含税金额:${label.currency_bwb}${label.total_grossamount_bwb}</p>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="leftBorder topBorder bottomBorder" colspan="11">
                <table style="width: 100%;margin: 0;">
                    <tr>
                        <td colspan="3">
                            <p style="text-align:left;font-size: 8px;line-height: 12px;">备注:${label.memo}</p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p style="text-align:left;font-size: 8px;line-height: 12px;">业务部:</p>
                        </td>
                        <td>
                            <p style="text-align:left;font-size: 8px;line-height: 12px;">部门主管:</p>
                        </td>
                        <td>
                            <p style="text-align:left;font-size: 8px;line-height: 12px;">财务部:</p>
                        </td>
                    </tr>
                </table>
            </td>
            <td class="leftBorder topBorder rightBorder bottomBorder" colspan="8">
                <p style="text-align: left;font-size: 8px;line-height: 12px;">出运方式：${label.shipmethod}</p>
                <p style="text-align: left;font-size: 8px;line-height: 12px;">发货地址：${label.shipaddress}</p>
                <p style="text-align: left;font-size: 8px;line-height: 12px;">业务员：${label.salesrep}</p>
                <p style="text-align: left;font-size: 8px;line-height: 12px;">联系方式：${label.contact}</p>
            </td>
        </tr>
        <tr>
            <td colspan="19">
                <p style="text-align: left;font-size: 8px;line-height: 14px;">
                    一式三联：第一联（白）：业务留存；第二联（蓝）：财务留存；第三联（黄）：生产留存；
                </p>
            </td>
        </tr>
        <tr>
            <td colspan="29">
                <p style="text-align: center;font-size:  12px;line-height: 16px;">
                    ${i} / ${pageSize}
                </p>
            </td>
        </tr>
    </table>
</div>
</#if>
</#list>
    </body>
</pdf>
